package com.bi.onlineEducation.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * course_type
 * @author 
 */
@Entity
@Table(name="course_type")
@ApiModel(value="com.bi.onlineEducation.domain.CourseTypePo")
@Data
public class CourseTypePo implements Serializable {
    /**
     * 课程类型主键ID
     */
    @Id
    @Column(name = "ct_id")
    @GeneratedValue(generator = "JDBC")
    @ApiModelProperty(value="课程类型主键ID")
    private Integer ctId;

    /**
     * 课程类型名称
     */
    @Column(name = "ct_name")
    @ApiModelProperty(value="课程类型名称")
    private String ctName;

    /**
     * 课程类型描述
     */
    @Column(name = "ct_desc")
    @ApiModelProperty(value="课程类型描述")
    private String ctDesc;

    /**
     * 课程类型创建人
     */
    @Column(name = "l_id")
    @ApiModelProperty(value="课程类型创建人")
    private Integer lId;

    @OneToOne(cascade = CascadeType.DETACH)//PurchasePo是关系的维护端，当删除 PurchasePo，会级联删除 CoursePo
    @JoinColumn(name = "l_id", referencedColumnName = "l_id", insertable = false, updatable = false)
    private LoginPo login;    //PurchasePo中的c_id字段参考CoursePo表中的id字段

    /**
     * 课程类型创建时间
     */
    @Column(name = "ct_create_time")
    @ApiModelProperty(value="课程类型创建时间")
    private Date ctCreateTime;

    private static final long serialVersionUID = 1L;
}